home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
351-375
/
disk_352
/
treewalk
/
rexx
/
hackup.ftw
< prev
next >
Wrap
Text File
|
1992-05-06
|
2KB
|
73 lines
/*
* backup treewalk routine - gets treewalk to check the exclusions
* list, and then copies the files that need copying.
*
* Copyright (C) 1989, 1990 Mike Meyer
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
in = arg(1) || arg(2)
out = 'backup'substr(in, index(in, ':'))
/* Hack to finish a full backup, just this once
if exists(out) | exists(out'.Z') then return 0
*/
/* if it passes the basic filter, then do it to it */
'' getclip("daily.backup")
if rc = 0 then
return copy(in, out)
/* Copy things in :lib, always and forever */
if index(in, ':lib/') ~= 0 then
return copy(in, out)
return 0
/*
* copy - makes sure the directory is in place for the destination,
* then copies infile to outfile.
*/
copy: procedure
return 0
parse arg infile, outfile
address command
/* Is the directory there? */
outdex = lastpos('/', outfile)
do while outdex > 0
outdir = substr(outfile, 1, outdex - 1)
if exists(outdir) then break
outdex = lastpos('/', outfile, outdex - 1)
end
outdex = index(outfile, '/', outdex + 1)
do while outdex > 0
outdir = substr(outfile, 1, outdex - 1)
'makedir "'outdir'"'
outdex = index(outfile, '/', outdex + 1)
end
'copy "'infile'" to "'outfile'"'
'compress "'outfile'"' /* Copy to ram some day... */
return rc ~= 0
/*
* Log - log the message we've been given.
*/
log: procedure
parse arg message
logfile = 'logs:backup.log'
if ~open(file, logfile, 'Append') then do
say "Can't open" logfile', exiting!'
exit
end
call writeln file, date() time() || ':' message
call close file
return